module.exports = (app) => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;

  const AttrsSchema = new Schema({
    attrName: {
      type: String,
      required: true,
    },
    attrValueList: [
      {
        valueName: {
          type: String,
          required: true,
        },
      },
    ],
    categoryId: {
      type: String,
      required: true,
    },
    categoryLevel: {
      type: Number,
      enum: [1, 2, 3],
      required: true,
    },
    isAdmin: {
      type: Boolean,
      default: false,
    },
  });

  return mongoose.model("Attrs", AttrsSchema, "Attrs");
};
